﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace HY.BLL.sys
{
  public  class sys_safe
    {

      public static DataTable getlist(string tab, string filed, string whe)
      {
          string strsql = "select " + filed + " from " + tab + " where 1=1  ";
          if (whe != "")
          { 
              if(whe.IndexOf("and")<0)
              strsql = strsql + " and " + whe;
              else
                  strsql = strsql +  whe;
          }
          return DAL.DbHelperSQL.SqlDataAdapter(strsql);
      }

      public static DataTable getlist(string tab, string whe)
      {
          string strsql = "select * from " + tab + " where 1=1  ";
          if (whe != "")
          {
              if (whe.IndexOf("and") < 0)
                  strsql = strsql + " and " + whe;
              else
                  strsql = strsql + whe;
          }
          return DAL.DbHelperSQL.SqlDataAdapter(strsql);
      }

    }
}
